﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LIMS.BLL
{
    public class AdminManager
    {
        private static LIMS.IDAL.IAdmin iAdmin = DALFactory.DataAccess<LIMS.IDAL.IAdmin>.CreateObject();

        /// <summary>
        /// 获得指定管理员的姓名
        /// </summary>
        /// <param name="adminID"></param>
        /// <returns></returns>
        public static String GetAdmNameByID(String adminID)
        {
            return iAdmin.FindName(adminID);
        }

        public static Boolean CheckAdminID(string adminID)
        {
            return iAdmin.CheckID(adminID);
        }

        public static Boolean AddAdmin(LIMS.Model.Admins admin)
        {
            if (iAdmin.CheckID(admin.adminID))
            {
                return iAdmin.InsertAdmin(admin);
            }
            return false;
        }

        public static LIMS.Model.Admins GetAdminByID(String adminid)
        {
            return iAdmin.FindByID(adminid);
        }

        public static List<LIMS.Model.Admins> GetAdmins()
        {
            return iAdmin.FindAll();
        }
        public static List<LIMS.Model.Admins> GetAdminByName(String adminName)
        {
            return iAdmin.FindByName(adminName);
        }

    }
}
